<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/white/common/common.jsp"%>
<%@include file="/white/common/taglibs.jsp"%>
<html>
<head>
<script type="text/javascript">
        <!--
        function validateAdd() {
        	var url = ""

			url = "";

			openWindow(url, 850, 700);
        }
        
        function submitForm(){
            var searchForm=document.getElementById("searchForm");
            searchForm.submit();
        }
        
        function notAllowedLockSelf(id){           
            var searchForm=document.getElementById("searchForm");
            searchForm.action="";
            searchForm.submit();            
        }
        
        function validateModify(){        	
        	var check = document.getElementsByName("selectedIds");
        	var a = 0;
            var id;
           
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a++;
                    id = check[i].value;
                }
            }
            
            if(a == 1){  
            	var url = "" 
            	         	
            	var searchForm=document.getElementById("searchForm");
            	
            	url = "";
            	
            	openWindow(url,850,500);
            }else{
                alert("请先选择一条记录!!");
            }
        }
        
        function validateModifyQuantity(){
        	var check = document.getElementsByName("selectedIds");
        	var a = 0;
            var id;
           
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a++;
                    id = check[i].value;
                }
            }
            
            if(a == 1){  
            	var url = "" 
            	         	
            	var searchForm=document.getElementById("searchForm");
            	
            	url = "";
            	
            	openWindow(url,850,500);
            }else{
                alert("请先选择一条记录!!");
            }
        }
        
        function validateDelete(){
            var check=document.getElementsByName("selectedIds");
            var a=false;
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a=true;
                    break;
                }
            }
            if(a){
                return confirm('你确定删除所选内容??');
            }else{
                alert("请先择你要删除的内容!!");
                return false;
            }
        }

        function doDelete(){
            var searchForm=document.getElementById("searchForm");
            searchForm.action='';
            searchForm.submit();
            return true;
        }
        
        function displayResult(){
            var result = "<s:property value='result'/>";
            if(result != null && result != ""){
                alert(result);
            }
        }    
            function tosearch(){
            var searchForm=document.getElementById("searchForm");
            searchForm.action='';
            searchForm.submit();
            }
            
            
                    function excel(){
            var searchForm=document.getElementById("searchForm");
            searchForm.action='';
            searchForm.submit();
            }
    </script>
</head>
<body onload="displayResult()">
	<s:form method="post" action="" theme="simple" id="searchForm">
		<div id="div_title">
			<h3>渠道商报表</h3>
			<div id="div_search">
				<table>
					<tr>
						<td width="80" align="right">产品:</td>
						<td><s:textfield name="" /></td>
						<td width="80" align="right">有效性:</td>
						<td><s:textfield name="" /></td>
					<tr>
						<td width="80" align="right"><%-- <authz:authorize
								ifAnyGranted="SMOOTH_ALL"> --%>
								<input type="button" class="submit_search" value="搜索"
									onClick="tosearch();">
							<%-- </authz:authorize> --%></td>
					</tr>
				</table>
			</div>
		</div>
		<div id="div_button">
		<%-- 	<authz:authorize ifAnyGranted="SMOOTH_ALL"> --%>
				<input type="button" value="新增"
					onclick="validateAdd();return false;" class="input_button" />
			<%-- </authz:authorize>
			<authz:authorize ifAnyGranted="SMOOTH_ALL"> --%>
				<input type="button" value="修改" onclick="validateModify()"
					class="input_button" />
			<%-- </authz:authorize>
			<authz:authorize ifAnyGranted="SMOOTH_ALL"> --%>
				<input type="button" value="删除"
					onclick="if(validateDelete()){doDelete()}" class="input_button">
			<%-- </authz:authorize> --%>

			<%@include file="/white/common/message.jsp"%>
		</div>
		<!--列表 开始 -->
		<table cellpadding="0" cellspacing="0" class="t_list">
			<tr>
				<th><input type="checkbox" onclick="selectCheckbox();"
					name="checkbox2" value="checkbox" /></th>
				<!--列表头部 -->
				<th>渠道账号</th>
				<th>渠道标识</th>
				<th>渠道名称</th>
				<th>渠道商数量</th>
			</tr>
			<s:iterator value="resultList" status="sindex">
				<tr>
					<td><input type="checkbox" name="selectedIds" value=""
						id="selectedIds" /></td>
					<td><s:property value="" /></td>
					<td><s:property value="" /></td>
					<td><s:property value="" /></td>
					<td><s:property value="" /></td>
				</tr>
			</s:iterator>
		</table>
		<!--列表 结束 -->
		<!--分页 开始 -->
		<s:if test="resultList.size() > 0">
			<table border="0" cellspacing="0" cellpadding="0" class="t_bottom">
				<tr>
					<td><%@include file="/white/common/pageList.jsp"%></td>
				</tr>
			</table>
		</s:if>
		<!--分页 结束 -->

	</s:form>
</body>
</html>
